﻿using Repid.Entity.Basic;
using Repid.MvcExtension.Controllers;
using Repid.Core.Aop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Repid.MvcApplication.Areas.Manage.Controllers
{
    public class SettingController : ManageController
    {
        public ActionResult Dialog()
        {
            return View();
        }

        public ActionResult Page()
        {
            return View();
        }

        [ValidateInput(false)]
        public string Global()
        {
            string[] settings = { "SiteKey", "DefRole", "Copyright" };

            var list = new List<BasicSetting>();

            foreach (var item in settings)
            {
                list.Add(new BasicSetting
                {
                    Tag = item,
                    Content = Request.Form[item],
                    Other = string.Empty
                });
            }

            return ServiceFactory.BasicSetting.SetContent(list).Serialize();
        }
    }
}